

import AsyncComponent from '@/utils/AsyncComponent/index'
// import Login from '@/views/Login/index'
// import HomeIndex from '@/views/HomeIndex/index';
// 一级路由
const Login = AsyncComponent(() => import('@/views/Login/index'))
const HomeIndex = AsyncComponent(() => import('@/views/HomeIndex/index'))
// er 
// // 二级路由
// import TableCom from '@/views/HomeIndex/pages/table'
// import FormCom from '@/views/HomeIndex/pages/form'
// import ListCom from '@/views/HomeIndex/pages/list'
// import Echarts from '@/views/HomeIndex/pages/echarts'

const TableCom = AsyncComponent(() => import('@/views/HomeIndex/pages/table'))
const FormCom = AsyncComponent(() => import('@/views/HomeIndex/pages/form'))
const ListCom = AsyncComponent(() => import('@/views/HomeIndex/pages/list'))
const Echarts = AsyncComponent(() => import('@/views/HomeIndex/pages/echarts'))


const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/homeIndex',
    component: HomeIndex,
    children: [
      {
        path: '/homeIndex',
        redirect: '/homeIndex/table'
      },
      {
        path: '/homeIndex/table',
        component: TableCom
      },
      {
        path: '/homeIndex/form',
        component: FormCom
      },
      {
        path: '/homeIndex/list',
        component: ListCom
      },
      {
        path: '/homeIndex/echarts',
        component: Echarts
      }
    ]
  }
]

export default routes;